﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CanDoo.Data.Entity;
using CanDoo.Oil.Core.Models;

namespace CanDoo.Oil.Core.ModelConfigurations
{
    /// <summary>
    /// 实体类-数据表映射——仓库
    /// </summary>
    public class WarehouseConfiguration : EntityConfigurationBase<Warehouse>
    {
        /// <summary>
        /// 初始化一个<see cref="WarehouseConfiguration"/>类型的新实例
        /// </summary>
        public WarehouseConfiguration()
        {
             ToTable("pro_Warehouse");
             this.Property(p => p.WarehouseTypeId).HasColumnName("WarehouseTypeId");
             this.HasRequired(p => p.WarehouseType).WithMany().HasForeignKey(p => p.WarehouseTypeId).WillCascadeOnDelete(false);

        }
    }
}
